import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { reportDetail,weekReport} from '@/types/report'

export const useReportStore = defineStore('report', () => {
  const report = ref<reportDetail>()
  const wreport=ref<weekReport>()
  //设置报告详情
  const setReport = (val: reportDetail) => {
    report.value = val
    console.log('报告详情',report.value)
  }
  //设置周报
  const setWeekReport=(val:weekReport) =>{
    wreport.value=val
  }
   
  // 清理报告详情
  const clearReport = () => {
    report.value = undefined
  }
  //清理周报
  const clearWeekReport=()=>{
    wreport.value=undefined
  }
  // 记得 return
  return {
    report,
    wreport,
    setReport,
    setWeekReport,
    clearReport,
    clearWeekReport
  }
})
